﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
    "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
	<title>{% block title %}{% endblock %}</title>
	<link href="/static/css/reset.css" rel="stylesheet" type="text/css">
	<link href="/static/css/styles.css" rel="stylesheet" type="text/css">
	{% block includes %}{% endblock %}
</head>
<body>
	<ul id="top-menu">
		{% if current_user is defined %}
			{% if current_user.is_authenticated() %}
				<li><a href="{{ 'userprofile.views.view_profile'|url }}">Профиль</a>&nbsp;<small><a href="{{ 'userprofile.views.edit_profile'|url }}">ред</a></small></li>
				<li><a href="{{ 'userprofile.views.view_list_profile'|url(id=current_userprofile.id) }}">Друзья{% if friendships_count %}({{ friendships_count }}){% endif %}	</a></li>
				<li><a href="{{ 'communication.views.show_message'|url }}">Сообщения{% if unread_messages_count %}({{ unread_messages_count }}){% endif %}</a></li>
				<li><a href="{{ 'django.contrib.auth.views.logout'|url }}">Выйти</a></li>
			{% endif %}
	    {% else %}
		    <li><a href="{{ 'registration.views.login'|url }}">Логин</a></li>
		    <li><a href="{{ 'registration.views.registration'|url }}">Регистрация</a></li>
	    {% endif %}
	</ul>
	<ul id="menu">
	{% block menu%}{% endblock %}
	</ul>
	<h1>{% block header %}{% endblock %}</h1>
	{% if success %}
		{% for succ in success %}
			<div class="success">{{ succ }}</div>
		{% endfor %}
	{% endif %}
	{% if errors %}
		{% for err in errors %}
			<div class="errors">{{ err }}</div>
		{% endfor %}
	{% endif %}
	<div class="clearing">&nbsp;</div>
	<div>
		{% block content %}
		{% endblock %}
	</div>
</body>
</html>